<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Add Course</title>
</h:head>
<f:view>
	<h:body>
		<ui:composition template="../includes/template.xhtml">
			<ui:define name="mainbody">
				<center>
					<h:form>


						<p:panel header="Add Course" style="min-height: 550px"
							styleClass="prime_panel">
							<center>
								<p:growl id="growl" showDetail="true" sticky="false"
									autoUpdate="true" showSummary="false" />
								<table border="0" cellpadding="4px" cellspacing="8px">

									<tr>
										<td><h:outputText value="Course Code:" />
											<h:outputText value="*" style="color:red" /></td>
										<td><p:inputText id="courseCode" style="width:200px"
												value="#{courseBean.course.courseCode}" required="true"
												requiredMessage="Please enter Course Code">
												<f:ajax execute="@this" event="blur" />
											</p:inputText>
										</td>
									</tr>
									<tr>
										<td><h:outputText value="Course Title :" />
											<h:outputText value="*" style="color:red" /></td>
										<td><p:inputText id="courseTitle" style="width:200px"
												value="#{courseBean.course.title}" required="true"
												requiredMessage="Please enter Course Title">
												<f:ajax execute="@this" event="blur" />
											</p:inputText>
										</td>
									</tr>
									<tr>
										<td><h:outputText value="Short Name :" /></td>
										<td><p:inputText id="shortName" style="width:200px"
												value="#{courseBean.course.shortName}" />
										</td>
									</tr>

									<tr>
										<td><h:outputText value="Currently offered: " /></td>
										<td><p:selectOneRadio style="width:200px"
												id="genderOptions"
												value="#{courseBean.course.currentStatus}">
												<f:selectItem itemLabel="Offered" itemValue="true" />
												<br />
												<f:selectItem itemLabel="Not Offered" itemValue="false" />
											</p:selectOneRadio>
										</td>
									</tr>
									<tr>
										<td><h:outputText value="Hours of classes/week :" />
											<h:outputText value="*" style="color:red" /></td>
										<td><p:tooltip for="hoursPerWeek" showEvent="focus"
												hideEvent="blur" /> <p:inputText style="width:200px"
												id="hoursPerWeek" value="#{courseBean.course.hoursPerWeek}"
												title="Please enter values like 1 or 2 or 3 etc"
												required="true"
												requiredMessage="Please enter Hours of Classes in a week">
												<f:ajax execute="@this" event="blur" />
											</p:inputText></td>
									</tr>
									<tr>
										<td><h:outputText value="One Class Duration :" />
											<h:outputText value="*" style="color:red" /></td>
										<td><p:tooltip for="classInterval" showEvent="focus"
												hideEvent="blur" /> <p:inputText id="classInterval"
												style="width:200px"
												value="#{courseBean.course.classInterval}"
												title="Please give value in terms of minutes"
												required="true"
												requiredMessage="Please enter Duration of one Class">
												<f:ajax execute="@this" event="blur" />
											</p:inputText>
										</td>
									</tr>
									<tr>
										<td><h:outputText value="Course Description :" /></td>
										<td><p:inputTextarea id="desc" style="width:200px"
												rows="5" cols="20" value="#{courseBean.course.description}" />
										</td>
									</tr>
									<tr>
										<td></td>
										<td style="text-align: right"><p:spacer width="5" /> <p:commandButton
												id="submit" value="Submit" type="submit" ajax="false"
												action="#{courseBean.performAction}" />
										</td>
									</tr>



								</table>
							</center>
						</p:panel>
					</h:form>
				</center>
			</ui:define>
		</ui:composition>
	</h:body>
</f:view>
</html>
